<div id="order-list">
<h1>订单列表</h1>
<table>
  <tr>
    <th>订单号</th>
    <th>客户号</th>
    <th>日期</th>
    <th>应到USD</th>
    <th>实到USD</th>
    <th>折合RMB</th>
    <th>总成本</th>
    <th>毛利润</th>
    <th>跟踪号</th>
    <th>订单状态</th>
    <th>业务员</th>
    <th colspan="3">操作</th>
  </tr>
<% for order in @orders %>
  <tr>
    <td><%=h order.order_num %></td>
    <td><%=h order.customer %></td>
    <td><%=h order.created_at.strftime("%Y-%m-%d") %></td>
    <td><%=number_to_usd order.sumusd_sh %></td>
    <td><%=number_to_usd order.sumusd_re %></td>
    <td><%=number_to_rmb order.sum_rmb %></td>
    <td><%=number_to_rmb order.total_cost %></td>
    <td><%=number_to_rmb order.profit %></td>
    <td><%=h order.track_num %></td>
    <td><%=h order.status %></td>
    <td><%=h order.user %></td>
    
    <!--
    <td><%=h order.sumusd_re %></td>
    <td><%=h order.payment %></td>   
    <td><%=h order.aim_area %></td>
    <td><%=h order.req_lang %></td>
    <td><%=h order.req_band %></td>
    <td><%=h order.req_manual %></td>
    <td><%=h order.req_charge %></td>
        <td><%=h order.delv_plan %></td>
    <td><%=h order.delv_real %></td>
    -->
    <td><%= link_to '查看', :controller=> 'store', :action => 'order_lines', :id => order.order_num %></td>
    <td><%= link_to '编辑', :controller=> 'store', :action => 'order_lines_edit', :id => order.order_num %></td>
    <td><%= link_to '删除', order, :confirm => '确认删除当前记录么?', :method => :delete %></td>
  </tr>
<% end %>
</table>
</div>
<%= if @orders.respond_to? 'total_pages' then will_paginate @orders end %>  

<%= link_to '新增订单', new_order_path %>
